import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

export function findAllProductSkuSaleListByPage(data) {
    return request({
        // url: sysPath + '/hx-mart/api/v1/product/productSkuSale/findAllProductSkuSaleListByPage', //弃用
        url: sysPath + '/hx-mart/api/v1/product/productSkuSale/pageByShop',
        method: 'post',
        data
    })
}

export function findAllProductSkuSaleListByShop(data) {
    return request({
        url: sysPath + '/hx-mart/api/v1/product/productSkuSale/pageByTargetShop',
        method: 'post',
        data
    })
}

export function findAllProductSkuSaleList(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/product/productSkuSale/findProductSkuSaleListByProductId',
        method: 'post',
        params
    })
}

export function save(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/productSkuSale/saveProductSkuSale',
		method: 'post',
		data: params
	})
}

export function stopSaleProductSkuSale(params) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/stopSaleProductSkuSale',
	    method: 'post',
	    params
	})
}

export function onSaleProductSkuSale(params) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/onSaleProductSkuSale',
	    method: 'post',
	    params
	})
}

export function batchOperateSaleStatus(params) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/batchOperateSaleStatus',
	    method: 'post',
	    params
	})
}

export function delProductSkuSale(params) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/delProductSkuSale',
	    method: 'post',
	    params
	})
}

export function editProductSkuSalePrice(data) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/price/change',
	    method: 'post',
	    data
	})
}

export function editProductSkuSaleStock(data) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/stock/edit',
	    method: 'post',
	    data
	})
}

export function editProductSkuSaleInfo(data) {
	return request({
	    url: sysPath + '/hx-mart/api/v1/product/productSkuSale/info/change',
	    method: 'post',
	    data
	})
}

export function exportSkuSaleList(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/productSkuSale/exportSkuSale',
		method: 'post',
        responseType: 'blob',
		data
	})
}

export function createQRcode(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/productSkuSale/share/miniqrcode',
		method: 'post',
		params
	})
}

export function exchangeProductList(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/exchange/page',
		method: 'post',
		data
	})
}

export function addExchangeProduct(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/exchange/add',
		method: 'post',
		data
	})
}

export function editExchangeProduct(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/exchange/edit',
		method: 'post',
		data
	})
}
